from rest_framework import serializers
from book.models import BookInfo,PeopleInfo


class BookInfoSerializer(serializers.ModelSerializer):
    class Meta:
        model = BookInfo
        fields = '__all__'


class PeopleInfoSerializer(serializers.ModelSerializer):

    class Meta:
        model = PeopleInfo
        fields = '__all__'
        extra_kwargs = {
            'name': {'min_length':2, 'max_length':10}
        }